/// <summary>
// CodeFx.MySqlProviders - .NET Providers for MySql using the framework CodeFx
// Laurent Morisseau
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
//
// Laurent Morisseau
/// </summary>
/// <author><a href="mailto:laurent.morisseau@gmail.com">Laurent Morisseau</a></author>

namespace CodeFx.MySqlProviders
{
	using System;
	using System.Text ;
	using System.Web;
	using System.Data;
    using CodeFx.Web;
    using MySql.Data.MySqlClient;

	public partial class Aspnet_personalizationallusersDAL: DALBase
	{
		/// <summary>
		/// Enumeration de tous les champs de aspnet_personalizationallusers
		/// <summary>
		public enum Fields 
		{ 
			#region Enumeration de tous les champs de aspnet_personalizationallusers
PathId,
PageSettings,
LastUpdatedDate
			#endregion
		}
	
		#region Private Properties aspnet_personalizationallusers
		/// <summary>
		/// Champ PathId de la table aspnet_personalizationallusers
		/// </summary>
		/// <remarks>Membre de la cle primaire. Membre d'une cle etrangere. </remarks>
		private uint _PathId;

		/// <summary>
		/// Champ PageSettings de la table aspnet_personalizationallusers
		/// </summary>
		/// <remarks>Membre Non Nullable. </remarks>
		private byte[] _PageSettings;

		/// <summary>
		/// Champ LastUpdatedDate de la table aspnet_personalizationallusers
		/// </summary>
		/// <remarks>Membre Non Nullable. </remarks>
		private DateTime _LastUpdatedDate;

		#endregion
		
		#region Public Properties
		
		public uint PathId
		{
			get {return this._PathId;}
			set {
					if ( this._PathId != value)
					{
						this.IsTouched = (this._PathId != value);
						this._PathId = value;
					}
				}
		}

		public byte[] PageSettings
		{
			get {return this._PageSettings;}
			set {
					if ( this._PageSettings != value)
					{
						this.IsTouched = (this._PageSettings != value);
						this._PageSettings = value;
					}
				}
		}

		public DateTime LastUpdatedDate
		{
			get {return this._LastUpdatedDate;}
			set {
					if ( this._LastUpdatedDate != value)
					{
						this.IsTouched = (this._LastUpdatedDate != value);
						this._LastUpdatedDate = value;
					}
				}
		}
		
		public string Key
        {
			get
			{
        	   	return this._PathId.ToString();
        	}
		}
		#endregion
		
		#region Override Methods
		public void Clone(Aspnet_personalizationallusersDAL dataObject)
        {
            if (dataObject == null)
                throw new ArgumentNullException("dataObject");
            	this._PageSettings = dataObject.PageSettings;
            	this._LastUpdatedDate = dataObject.LastUpdatedDate;
        }
		
       	public override sealed string ToString()
        {
            StringBuilder Text = new StringBuilder( this.GetType().FullName );
			Text.AppendFormat( "\r\n \t{0} {2}: {1}", "PathId", this.PathId, "PK FK " );
			Text.AppendFormat( "\r\n \t{0} {2}: {1}", "PageSettings", this.PageSettings, "" );
			Text.AppendFormat( "\r\n \t{0} {2}: {1}", "LastUpdatedDate", this.LastUpdatedDate, "" );
			return Text.ToString();
        }
		
		public override sealed void Read(IDataReader reader)
        {
            if (reader == null)
                throw new ArgumentNullException("reader");
            base.Read(reader);
			MySqlDataReader myreader = (MySqlDataReader)reader;
this._PathId= myreader.GetUInt32((int)Aspnet_personalizationallusersDAL.Fields.PathId);
this._PageSettings= myreader.GetValue((int)Aspnet_personalizationallusersDAL.Fields.PageSettings) as byte[];
this._LastUpdatedDate= myreader.GetDateTime((int)Aspnet_personalizationallusersDAL.Fields.LastUpdatedDate);
        }

        public override sealed void Write(IDbCommand cmd)
        {
			if (cmd == null)
                throw new ArgumentNullException("cmd");
            base.Write(cmd);
cmd.Parameters.Add(new MySqlParameter("?PathId", this._PathId));
cmd.Parameters.Add(new MySqlParameter("?PageSettings", this._PageSettings));
cmd.Parameters.Add(new MySqlParameter("?LastUpdatedDate", this._LastUpdatedDate));
        }

		public override sealed void WriteId(IDbCommand cmd)
        {
            if (cmd == null)
                throw new ArgumentNullException("cmd");
            base.WriteId(cmd);
cmd.Parameters.Add(new MySqlParameter("?PathId", this._PathId));
        }
        #endregion
				
	}
}
